Skip to content

docs: tighten comment rules based on recurring review feedback - #10

Merged
Uhucream merged 1 commit into
mainfrom
claude/comment-rules-swiftmd
Jul 29, 2026
Merged

docs: tighten comment rules based on recurring review feedback#10
Uhucream merged 1 commit into
mainfrom
claude/comment-rules-swiftmd

Conversation

@Uhucream

Copy link
Copy Markdown
Owner

Summary

  • Adds two patterns to ## Documentation Comments: describe the caller-facing effect, not internal mechanism vocabulary (e.g. "borrow"/"pool"); state facts declaratively rather than instructing the reader, matching Apple's own DocC discussion style.
  • Adds a new ## Regular Comments (//) section: a comment justifies why this implementation was chosen, not a memo of what was learned while writing/debugging, and not a restatement of something already evident from the code (e.g. a signature forced by protocol conformance — no comment needed at all in that case). Also covers not naming a specific consumer type in a comment on general-purpose code, since that goes stale as soon as callers change.

These codify recurring feedback given during review of a separate PR (#8) — the same categories of comment mistakes kept recurring, so the rule needed to be explicit rather than re-derived each time.

Test plan

  • Rules-only change to .claude/rules/swift.md; no application code touched, so no build/CI impact.

Generated by Claude Code

Add two patterns to Documentation Comments (describe the caller-facing
effect, not internal mechanism vocabulary; state facts declaratively
rather than instructing the reader) and a new Regular Comments (//)
section establishing what a comment is for: justifying why this
implementation was chosen, not a memo of what was learned while writing
or debugging it, and not a restatement of something already evident
from the code (e.g. a signature forced by protocol conformance). Also
covers not naming a specific consumer type in a comment on
general-purpose code, since that goes stale as soon as callers change.
@Uhucream
Uhucream merged commit 54336bc into main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants